# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2004 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
#/bin/bash

# This script is used in order to display the running hdwr_svr and fnmd
#   threads from the restricted shell instead of using the ps command.
#   It is invoked without operands and does not detect whether extraneous
#   operands are supplied.

USAGE="Usage:  lsSNM [ -h ]"

# First check for existence of parameters, then check validity
if (( $# == 1 ))
then
    while test -n "$1"
        do
            case $1 in
                -h) echo $USAGE; exit 0;;
                 *) echo $USAGE; exit 1;;
            esac
        done
fi

/bin/ps -fwwwC hdwr_svr
THREADS=`/bin/ps -fwwwC fnmd | /usr/bin/grep fnmd | /usr/bin/wc -l`
echo "There are $THREADS fnmd threads."

grep_results=`/bin/ps -e | /usr/bin/grep fnmd`
if [[ $grep_results != "" ]]
  then
	/bin/ps -fwwwC fnmd
fi
